package com.demo.xj_plane.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.xj_plane.dao.XjLiveSaMapper;
import com.demo.xj_plane.entity.XjLiveSaEntity;
import com.demo.xj_plane.service.XjLiveSaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class XjLiveSaServiceImpl extends ServiceImpl<XjLiveSaMapper, XjLiveSaEntity> implements XjLiveSaService {
    @Autowired
    private XjLiveSaMapper xjLiveSaMapper;

    @Override
    public boolean selectExist(String cccc, String type, String oDateTime) {
        // 判断是否有重复
        int i = xjLiveSaMapper.selectExist(cccc, type, oDateTime);
        if(i > 0){
            return true;
        }
        return false;
    }

    @Override
    public String selectLatestData(String cccc, String type) {
        return xjLiveSaMapper.selectLatestData(cccc, type);
    }

    @Override
    public List<String> selectContentLast24Hours(String type, String oDateTime) {
        return xjLiveSaMapper.selectContentLast24Hours(type, oDateTime);
    }

    @Override
    public XjLiveSaEntity selectFourGridsData(String cccc) {
        return xjLiveSaMapper.selectFourGridsData(cccc);
    }

    @Override
    public String selectContentLast30Min(String cccc, String type, String oDateTime) {
        return xjLiveSaMapper.selectContentLast30Min(cccc, type, oDateTime);
    }
}
